define(['jq'],()=>{
    var cart = document.querySelector('.Shopping-cart>img')
    var mask = document.querySelector('.mask')
    var nav = document.querySelector('#nav')
    var span = document.querySelector('.mask>div>div>span')
   
   
    cart.onclick = ()=>{
        mask.style.display = 'block'
        // nav.style.display = 'none'
    }
    span.onclick = ()=>{
        nav.style.display = 'block'
        mask.style.display = 'none'
    }
})
var input = document.querySelector('.mask>div>div>input')
    var ul = document.querySelector('.mask>.mask-ul')
    // console.log(ul,input)
    
   
    function getList(res) {
        console.log(res)
        ul.innerHTML = ''
        res.s.forEach(item => {
            ul.innerHTML += `
            <li>
                ${item}
                </li>
            `

        });
    }

    // 绑定事件  
    input.oninput = function () {
        // console.log(input.value)
        this.value = this.value.trim()
        if (this.value.length == 0) {
            ul.innerHTML = ''
            return
        }
        jsonP('https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su', {
            cb: 'getList',
            wd: this.value
        })
    }